#ifndef _TIMER_8_BIT_WITH_PWM_H_
#define _TIMER_8_BIT_WITH_PWM_H_



	enum WaveformGenerationMode
	{
		Normal,
		PWM_Phase_Correct,
		CTC,
		Fast_PWM
	};


	enum CompareMatchOutputMode
	{
		NormalPortOperation_OC0_Disconnected,
		ToggleOC0onCompareMatch,
		ClearOC0onCompareMatch,
		SetOC0onCompareMatch
	};

	enum ClockSelectTimer8Bit
	{
		NoClockSource,
		NoPrescaling,
		Prescaler8,
		Prescaler64,
		Prescaler256,
		Prescaler1024,
		ExternalClockFalling,
		ExternalClockRising
	};


class Timer8BitPWM
{
	public :

	void setForceOutputCompare(unsigned char flag);

	unsigned long int getFrequency(unsigned int prescaler,
						unsigned long int ClK_IO,
						unsigned long int OCR_Count
						);


	void setWaveformGenerationMode(unsigned char flag);




	unsigned long int getFrequency(unsigned int prescaler,
						unsigned long int ClK_IO,
						unsigned long int OCR_Count
						);

	unsigned long int getPWMFrequency(unsigned int N,
							unsigned long int
							CLK_IO);

	unsigned long int getPWM_PhaseCorrectFrequency(
						unsigned int N,
						unsigned long int CLK_IO);



	void setCompareMatchOutputMode(unsigned char flag);


	void setClockSelect(unsigned char flag);


	void setCounterRegister(unsigned char flag); //TCNT

	unsigned char getCounterRegister();


	void setOutputCompare(unsigned char flag);

	unsigned char getOutputCompare();

	void setCounter0OutputCompareMatchInterruptEnable(unsigned char flag);

	void setCounter0OverflowInterruptEnable(unsigned char flag);

	unsigned char getOutputCompareFlag0();

	unsigned char getOutputCompareOverflow0();

	void setPrescalerReset(unsigned char flag);

};



#endif
